package com.gitee.huanminabc.jlambda_sql.segments;


import com.gitee.huanminabc.jlambda_sql.base.SqlFun;

/**
 * @Author huanmin
 * @Date 2024/6/18 下午6:36
 */
public interface CaseWhenSegments<Children> extends SqlFunSegments<Children> {

    Children CASE();

    <Y> Children CASE(SqlFun<Y, ?> column);

    Children WHEN(Object param);

    Children THEN(Object expression);

    Children ELSE(Object expression);

    <Y> Children ELSE(SqlFun<Y, ?> column);

    Children END(String alias);

    Children END();




    Children IF(Object expression, Object value_if_true, Object value_if_false);



    Children IF(SqlFun<Children, Children> sql, Object value_if_true, Object value_if_false);



    //if(column=param,value_if_true,value_if_false)
    <Y> Children IF(SqlFun<Y, ?> column, Object param, SqlFun<Y, ?> value_if_true, Object value_if_false);

    <Y> Children IF(SqlFun<Y, ?> column, Object param, SqlFun<Y, ?> value_if_true, SqlFun<Y, ?> value_if_false);

    //if(column=param,value_if_true,value_if_false)
    <Y> Children IF(SqlFun<Y, ?> column, Object param, Object value_if_true, Object value_if_false);
}
